Skip to content

feat: m2m rest client#47

Open
nurtai325 wants to merge 35 commits into
mainfrom
feature/m2m-rest-client
Open

feat: m2m rest client#47
nurtai325 wants to merge 35 commits into
mainfrom
feature/m2m-rest-client

Conversation

@nurtai325
Copy link
Copy Markdown
Contributor

Use new Kubernetes tokens instead of old m2m tokens in rest clients. We expect the new libraries to be used with new core versions so no fallback to old method considered. Also make unit test mock servers validate the token

@nurtai325 nurtai325 force-pushed the feature/m2m-rest-client branch from eadf0a9 to ea98fac Compare May 4, 2026 08:49
public DbaasClient build() {
String url = config.dbaasAgentUrl().orElse(DEFAULT_DBAAS_AGENT_ADDRESS);
OkHttpClient httpClient = new OkHttpClient.Builder()
System.setProperty(M2MClientFactory.DBAAS_AGENT_URL_PROP, url);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is global and may affect on other tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return M2MClientFactory.getM2mOkHttpClient(() -> M2MManager.getInstance().getToken().getTokenValue())
.newBuilder()
.retryOnConnectionFailure(true)
.sslSocketFactory(TlsUtils.getSslContext().getSocketFactory(), TlsUtils.getTrustManager())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLS? Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw that at another place. Should I remove it?

@nurtai325 nurtai325 force-pushed the feature/m2m-rest-client branch from b7d4a55 to 77b3a61 Compare May 13, 2026 04:10
@nurtai325 nurtai325 force-pushed the feature/m2m-rest-client branch from 229ef4b to 4f42660 Compare May 14, 2026 02:15
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
71.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants